import { animated, config, useSpring } from "@react-spring/web";

const ReactSpringDemo = () => {
  const divStyles = useSpring({
    from: { opacity: 0, x: 0 },
    to: { opacity: 1, x: 200 },
    config: config.slow,
    loop: true,
  });

  return (
    <animated.div
      style={{
        ...divStyles,
        width: "50px",
        height: "50px",
        background: "lightpink",
      }}
    ></animated.div>
  );
};

export default ReactSpringDemo;
